Skip to content

fix(scim): keep list-of-strings values flat when converting response keys - #2041

Open
pcbeingused333 wants to merge 1 commit into
slackapi:mainfrom
pcbeingused333:fix/scim-schemas-nested-c3345
Open

pcbeingused333 wants to merge 1 commit into
slackapi:mainfrom
pcbeingused333:fix/scim-schemas-nested-c3345

Conversation

@pcbeingused333

Copy link
Copy Markdown

Summary

SCIM responses with list-of-string fields (for example schemas) came back nested after the snake_case key conversion, so user.schemas from read/search/create/patch user responses was [["urn:a", "urn:b"], ["urn:a", "urn:b"]] instead of ["urn:a", "urn:b"]. No related issue.

Root cause: in _convert_dict_keys (slack_sdk/scim/v1/internal_utils.py), the branch for lists whose first element is not a dict appended _create_copy(original_value) (the whole list) once per element. The fix appends _create_copy(element). Lists of dicts such as emails take the other branch and are unchanged.

Testing

python -m pytest tests/slack_sdk/scim -q. The new test_snake_cased_list_of_strings in tests/slack_sdk/scim/test_internals.py fails before the change and passes after it.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

This change was prepared with the help of an AI coding assistant (Claude) and submitted by a human contributor.

@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 14, 2026 18:55
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @pcbeingused333 to sign the Salesforce Inc. Contributor License Agreement.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant